<?php
$userVersion = getOption('current_version');
$appVersion = file_get_contents(CN_APPLICATION_PATH.'application/version.txt');

if($userVersion < '2.1') {
	DB()->query("ALTER TABLE `cn_uploads` ADD COLUMN `upload_order` INT (11)");
	DB()->query("CREATE TABLE IF NOT EXISTS `cn_user_groups` (
  `group_id` int(5) NOT NULL AUTO_INCREMENT,
  `group_name` varchar(50) NOT NULL,
  PRIMARY KEY (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1");
}

if($userVersion < '2.1.0.1') {
	DB()->query("ALTER TABLE `cn_content_content_relations` ADD `ccr_content1_qualifier` VARCHAR (100)");
	DB()->query("ALTER TABLE `cn_content_content_relations` ADD `ccr_content2_qualifier` VARCHAR (100)");
	DB()->query("ALTER TABLE `cn_content_content_relations` ADD `ccr_content3_qualifier` VARCHAR (100)");
	DB()->query("ALTER TABLE `cn_content_content_relations` ADD `ccr_content1_quantifier` INT (11)");
	DB()->query("ALTER TABLE `cn_content_content_relations` ADD `ccr_content2_quantifier` INT (11)");
	DB()->query("ALTER TABLE `cn_content_content_relations` ADD `ccr_content3_quantifier` INT (11)");
	
	DB()->query("ALTER TABLE `cn_user_content_relations` ADD `ucr_content_quantifier` INT (11)");
	DB()->query("ALTER TABLE `cn_user_content_relations` ADD `ucr_content_qualifier` VARCHAR (100)");
	
}


setOption('current_version', $appVersion);

?>